package com.kyk.kktakeaway.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 订单商品表
 * </p>
 *
 * @author 凯
 * @since 2025-09-12
 */
@Getter
@Setter
@TableName("order_items")
public class OrderItems implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单商品ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单ID
     */
    private Long orderId;

    /**
     * 商品ID(可能为NULL，如果商品已删除)
     */
    private Long productId;

    /**
     * 商品名称(下单时的快照)
     */
    private String productName;

    /**
     * 商品图片(下单时的快照)
     */
    private String productImage;

    /**
     * 商品价格(下单时的快照)
     */
    private BigDecimal price;

    /**
     * 购买数量
     */
    private Integer quantity;

    /**
     * 商品总金额
     */
    private BigDecimal totalAmount;

    private LocalDateTime createdAt;
}
